package cn.rui.pojo.exam;

import cn.rui.pojo.User;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * @author 徽州大都督
 * @date 2021/6/24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "试题类",value = "试题类")
@TableName("sys_exam_question")
public class ExamQuestion implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 题目类型(1单选题，2多选题，3判断题，4简答题)
     */
    private Integer questionType;


    /**
     * 创建人ID
     */
    private Integer userId;

    /**
     * 创建人
     */
    @TableField(exist = false)
    private User user;

    /**
     * 题目内容
     */
    private String questionContent;

    /**
     * 答案A
     */
    private String optionA;

    /**
     * 答案B
     */
    private String optionB;

    /**
     * 答案C
     */
    private String optionC;

    /**
     * 答案D
     */
    private String optionD;

    /**
     * 判断题答案 1对  0错
     */
    private Integer trueFalse;

    /**
     * 简答题参考答案
     */
    private String answerContent;

    /**
     * 单选题参考答案
     */
    private String radioAnswer;

    /**
     * 多选题参考答案
     */
    private String selectAnswer;

    @TableField(exist = false)
    private Set<String> selectAnswerList;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    @TableLogic
    private Integer delFlag;
}
